home *** CD-ROM | disk | FTP | other *** search
/ ADA Programming Guide / ADA Programming Guide.iso / adatutor / simlatrs / buoy.spc < prev    next >
Text File  |  1996-01-30  |  4KB  |  126 lines

  1. -- ********************************************
  2. -- *                                          *
  3. -- *  Buoy_Sensor_Interface                   *  SPEC
  4. -- *                                          *
  5. -- ********************************************
  6. package Buoy_Sensor_Interface is
  7.  
  8.   type BUOY_ID is (B01, B02, B03, B04, B05,
  9.                    B06, B07, B08, B09, B10,
  10.                    B11, B12, B13, B14, B15,
  11.                    B16, B17, B18, B19, B20);
  12.  
  13.   type OFF_ON is (OFF, ON);
  14.  
  15.   type TEMPERATURE is new FLOAT
  16.       range -100.0 .. 300.0;     -- Fahrenheit
  17.  
  18.   type SPEED is new FLOAT
  19.       range 0.0 .. 200.0;        -- MPH
  20.  
  21.   type NSEW is (NORTH, SOUTH, EAST, WEST);
  22.   type DEGREE is new FLOAT
  23.       range 0.0 .. 90.0;         -- Degrees
  24.   type COORDINATE is record
  25.     Direction : NSEW;
  26.     Offset    : DEGREE;
  27.   end record;
  28.   type LOCATION is record
  29.     Latitude  : COORDINATE;
  30.     Longitude : COORDINATE;
  31.   end record;
  32.  
  33.   -- .............................................
  34.   -- .                                           .
  35.   -- .  Buoy_Sensor_Interface.Air_Temperature    .  SPEC
  36.   -- .                                           .
  37.   -- .............................................
  38.   function Air_Temperature (ID : in BUOY_ID)
  39.       return TEMPERATURE;
  40.   --| Purpose
  41.   --|    Return the Air Temperature around the buoy.
  42.   --|
  43.   --| Notes
  44.   --|    Update must be called to update the status
  45.   --| of the buoy sensors first.
  46.  
  47.   -- .............................................
  48.   -- .                                           .
  49.   -- .  Buoy_Sensor_Interface.Water_Temperature  .  SPEC
  50.   -- .                                           .
  51.   -- .............................................
  52.   function Water_Temperature (ID : in BUOY_ID)
  53.       return TEMPERATURE;
  54.   --| Purpose
  55.   --|    Return the Water Temperature around the buoy.
  56.   --|
  57.   --| Notes
  58.   --|    Update must be called to update the status
  59.   --| of the buoy sensors first.
  60.  
  61.   -- .............................................
  62.   -- .                                           .
  63.   -- .  Buoy_Sensor_Interface.Wind_Speed         .  SPEC
  64.   -- .                                           .
  65.   -- .............................................
  66.   function Wind_Speed (ID : in BUOY_ID)
  67.       return SPEED;
  68.   --| Purpose
  69.   --|    Return the Wind Speed around the buoy.
  70.   --|
  71.   --| Notes
  72.   --|    Update must be called to update the status
  73.   --| of the buoy sensors first.
  74.  
  75.   -- .............................................
  76.   -- .                                           .
  77.   -- .  Buoy_Sensor_Interface.Global_Position    .  SPEC
  78.   -- .                                           .
  79.   -- .............................................
  80.   function Global_Position (ID : in BUOY_ID)
  81.       return LOCATION;
  82.   --| Purpose
  83.   --|    Return the location of the buoy.
  84.   --|
  85.   --| Notes
  86.   --|    Update must be called to update the status
  87.   --| of the buoy sensors first.
  88.  
  89.   -- .............................................
  90.   -- .                                           .
  91.   -- .  Buoy_Sensor_Interface.Red_Light          .  SPEC
  92.   -- .                                           .
  93.   -- .............................................
  94.   function Red_Light (ID : in BUOY_ID) return OFF_ON;
  95.   --| Purpose
  96.   --|    Indicate if the red light is on or off.
  97.   --|
  98.   --| Notes
  99.   --|    Update must be called to update the status
  100.   --| of the buoy sensors first.
  101.  
  102.   -- .............................................
  103.   -- .                                           .
  104.   -- .  Buoy_Sensor_Interface.Yellow_Light       .  SPEC
  105.   -- .                                           .
  106.   -- .............................................
  107.   function Yellow_Light (ID : in BUOY_ID) return OFF_ON;
  108.   --| Purpose
  109.   --|    Indicate if the yellow light is on or off.
  110.   --|
  111.   --| Notes
  112.   --|    Update must be called to update the status
  113.   --| of the buoy sensors first.
  114.  
  115.   -- .............................................
  116.   -- .                                           .
  117.   -- .  Buoy_Sensor_Interface.Update             .  SPEC
  118.   -- .                                           .
  119.   -- .............................................
  120.   procedure Update (ID : in BUOY_ID);
  121.   --| Purpose
  122.   --|    Update the buoy sensors' status.
  123.  
  124. end Buoy_Sensor_Interface;
  125.  
  126.